home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Text / Edit / Vim / doc / vim.hlp < prev    next >
Text File  |  1994-08-14  |  31KB  |  572 lines

  1.                      VIM help file index
  2.  
  3. RETURN quit help                VIM stands for Vi IMproved.
  4.  SPACE  one page forward        Most of VIM was made by Bram Moolenaar.
  5.      a  go to this index
  6.      b  one page backward
  7.  
  8. c   left-right and up-down motions   q   options i-n
  9. d   word and text object motions     r   options p-s
  10. e   pattern searches                 s   options s-t
  11. f   various motions; using tags      t   options t-y
  12. g   scrolling                        u   undo; shell; quickfix; various
  13. h   inserting text; digraphs         v   command line editing
  14. i   insert mode                      w   Ex ranges; Ex special characters
  15. j   changing text                    x   editing files
  16. k   complex changes                  y   using the file list
  17. l   deleting, copying, moving text   z   writing and quitting
  18. m   repeating commands               A   starting VIM
  19. n   key mapping; abbreviations       B   multi window functions
  20. o   option commands, options a-c     C   buffer list functions
  21. p   options d-h
  22.  
  23. Read "reference.doc" for a more complete explanation.
  24. Left-right motions
  25. N  h            left (same as CTRL-H, BS and cursor-left key)
  26. N  l            right (same as SPACE and cursor-right key)
  27.    0            to first character in the line
  28.    ^            to first non-blank character in the line
  29. N  $            to the last character in the line (N-1 lines lower)
  30. N  |            to column N
  31. N  f<char>      to the Nth occurrence of <char> to the right
  32. N  F<char>      to the Nth occurrence of <char> to the left
  33. N  t<char>      till before the Nth occurrence of <char> to the right
  34. N  T<char>      till before the Nth occurrence of <char> to the left
  35. N  ;            repeat the last f, F, t or T N times
  36. N  ,            repeat the last f, F, t or T N times in opposite direction
  37.  
  38. Up-down motions
  39. N  k            up (same as CTRL-P and cursor-up key)
  40. N  j            down (same as CTRL-J, CTRL-N, LF and cursor-down key)
  41. N  -            up, on the first non-blank character
  42. N  +            down, on the first non-blank char. (same as CTRL-M and CR)
  43. N  _            N - 1 lines down, on the first non-blank character
  44. N  G            goto line N (default last line), on the first non-blank char.
  45. N  %            goto line N percentage down in the file.
  46. Word motions
  47. N  w            N words forward
  48. N  W            N blank-separated words forward
  49. N  e            forward to the end of the Nth word
  50. N  E            forward to the end of the Nth blank-separated word
  51. N  b            N words backward
  52. N  B            N blank-separated words backward
  53.  
  54. Text object motions
  55. N  )            N sentences forward
  56. N  (            N sentences backward
  57. N  }            N paragraphs forward
  58. N  {            N paragraphs backward
  59. N  ]]           N sections forward
  60. N  [[           N sections backward
  61. N  ][           N sections (starting with a <}>) forward
  62. N  []           N sections (starting with a <}>) backward
  63. N  [(  [{       N times back to unclosed <(> or <{>
  64. N  ])  ]}       N times forward to unclosed <(> or <{>
  65. Pattern searches
  66. N  /{pattern}[/]        search forward for the Nth occurrence of {pattern}
  67. N  ?{pattern}[?]        search backward for the Nth occurrence of {pattern}
  68. N  /                    repeat last search, in the forward direction
  69. N  ?                    repeat last search, in the backward direction
  70. N  n                    repeat last search
  71. N  N                    repeat last search, in opposite direction
  72. N  *                    search forward for the ident under the cursor
  73. N  #                    search backward for the ident under the cursor
  74.  
  75. special characters in search patterns      magic      nomagic
  76.            matches any single character      .            \.
  77.                   matches start of line      ^            ^
  78.                     matches end of line      $            $
  79.                   matches start of word      \<           \<
  80.                     matches end of word      \>           \>
  81.    matches a single char from the range      [a-z]        \[a-z]
  82.  matches a single char not in the range      [^a-z]       \[^a-z]
  83. matches 0 or more of the preceding atom      *            \*
  84. matches 1 or more of the preceding atom      \+           \+
  85.    matches 0 or 1 of the preceding atom      \=           \=
  86.                  separates two branches      \|           \|
  87.            group a pattern into an atom      \(\)         \(\)
  88. Various motions
  89.    m<a-zA-Z>    mark current position with mark <a-zA-Z>
  90.    `<a-zA-Z>    go to mark <a-zA-Z>
  91.    ``           go to the position before the last jump
  92.    `[ or `]     go to the start or end of the previously operated or put text
  93.    '<a-zA-Z[]'> same as `, but on the first non-blank in the line
  94. :marks          print the active marks
  95. N  CTRL-O       go to N older position in jump list
  96. N  CTRL-I       go to N newer position in jump list
  97. :jumps          print the jump list
  98.    %            find the next brace, bracket, comment or #if/#else/#endif in
  99.                 this line and go to its match
  100. N  H            go to the Nth line in the window, on the first non-blank
  101.    M            go to the middle line in the window, on the first non-blank
  102. N  L            go to the Nth line from the bottom, on the first non-blank
  103.  
  104. Using tags
  105. :ta[g][!] {tag}         Jump to tag {tag}, unless changes have been made
  106.    CTRL-]               Jump to the tag under cursor, unless changes made
  107. N  CTRL-T               Jump to N older tag in tag list
  108. :[count]po[p][!]        Jump to [count] older tag in tag list
  109. :[count]ta[g][!]        Jump to [count] newer tag in tag list
  110. :tags                   Print tag list
  111. Scrolling
  112. N  CTRL-E       window N lines downwards (N lines Extra)
  113. N  CTRL-D       window N lines Downwards (default half a window)
  114. N  CTRL-F       window N pages Forwards (downwards)
  115. N  CTRL-Y       window N lines upwards
  116. N  CTRL-U       window N lines Upwards (default half a window)
  117. N  CTRL-B       window N pages Backwards (upwards)
  118.    z<CR> or zt  redraw, current line at top of window
  119.    z.    or zz  redraw, current line at center of window
  120.    z-    or zb  redraw, current line at bottom of window
  121. Inserting text
  122. N  a            append text after the cursor (N times)
  123. N  A            append text at the end of the line (N times)
  124. N  i            insert text before the cursor (N times)
  125. N  I            insert text before the first non-blank in the line (N times)
  126. N  o            open a new line below the current line, append text (N times)
  127. N  O            open a new line above the current line, append text (N times)
  128.  
  129. Special inserts
  130. :r [file]       insert the contents of [file] below the cursor
  131. :r!{command}    insert the standard output of {command} below the cursor
  132.  
  133. Digraphs
  134. :dig[raphs]     show current list of digraphs
  135. :dig[raphs] {char1}{char2} {number} ...
  136.                 add digraph(s) to the list
  137. char              action in insert mode
  138. CTRL-[ or <ESC>   end insert or replace mode, back to command mode
  139. CTRL-A            insert previously inserted text
  140. CTRL-@            insert previously inserted text and stop insert
  141. CTRL-R <0-9a-z%:> insert contents of register <0-9a-z%:>
  142. CTRL-J or <LF> or CTRL-M or <CR>   begin new line
  143. CTRL-K {char1} {char2}  enter digraph
  144. CTRL-E / CTRL-Y   insert the character which is below/above the cursor
  145. CTRL-V            insert character literally, or enter decimal byte value
  146. CTRL-N / CTRL-P   insert next/previous match of identifier before the cursor
  147. CTRL-H or <BS> or <DEL> delete the character before the cursor
  148. CTRL-W            delete word before the cursor
  149. CTRL-U            delete all entered characters in the current line
  150. CTRL-T            insert one shiftwidth of indent in the current line
  151. CTRL-D            delete one shiftwidth of indent in the current line
  152. 0 CTRL-D or ^ CTRL-D    delete all indent in the current line
  153. {char1} <BS> {char2}    enter digraph if 'dg' option set
  154. CTRL-B            toggle 'revins' (reverse insert) option
  155.         keys that stop insert, do something and get back to insert:
  156. cursor keys       move cursor left/right/up/down
  157. shift-up/down     one screenfull backward/forward
  158. shift-left/right  one word left/right
  159. CTRL-O {command}  execute {command}
  160. Changing text
  161. N  R            enter replace mode (repeat the entered text N times)
  162. N  c{motion}    change the text that is moved over with {motion}
  163. {visual}c       change the highlighted text
  164. N  cc           change N lines
  165. N  C            change to end of line (and N-1 more lines)
  166. N  s            change N characters
  167. N  S            change N lines
  168. N  r<char>      replace N characters by <char>
  169. N  ~            switch case for N characters and advance cursor
  170. {visual}~       switch case for highlighted text
  171. {visual}u       make highlighted text lowercase
  172. {visual}U       make highlighted text uppercase
  173. N  CTRL-A       add N to the number at or after the cursor
  174. N  CTRL-X       subtract N from the number at or after the cursor
  175. N  <{motion}    move the lines that are moved over one shiftwidth left
  176. N  <<           move N lines one shiftwidth left
  177. N  >{motion}    move the lines that are moved over one shiftwidth right
  178. N  >>           move N lines one shiftwidth right
  179. N  Q{motion}    format the lines that are moved over to 'textwidth' length
  180. :[range]ce[nter] [width]   center the lines in [range]
  181. :[range]le[ft] [indent]    left align the lines in [range] [with indent]
  182. :[range]ri[ght] [width]    right align the lines in [range]
  183. Complex changes
  184.    v            start highlighting characters  } move cursor and use
  185.    V            start highlighting linewise    } operator to affect
  186.    CTRL-V       start highlighting blockwise   } highlighted text
  187.    o            exchange cursor position with start of highlighting
  188.  
  189. N  !{motion}{command}
  190.                 filter the lines that are moved over through {command}
  191. N  !!{command}
  192.                 filter N lines through {command}
  193. :[range]!{command}
  194.                 filter [range] lines through {command}
  195. N  ={motion}{command}
  196.                 filter the lines that are moved over through "indent"
  197. N  =={command}
  198.                 filter N lines through "indent"
  199. :[range]s[ubstitute]/{pattern}/{string}/[g][c]
  200.                 substitute {pattern} by {string} in [range] lines; with [g]
  201.                 replace all occurrences of {pattern}; with [c] ask first
  202. :[range]s[ubstitute] [g][c]
  203.                 repeat previous :s with new range and options
  204.    &            Repeat previous :s on current line without options
  205.  
  206. Deleting text
  207. N  x            delete N characters under and after the cursor
  208. N  X            delete N characters before the cursor
  209. N  d{motion}    delete the text that is moved over with {motion}
  210. {visual}d       delete the highlighted text
  211. N  dd           delete N lines
  212. N  D            delete to end of line (and N-1 more lines)
  213. N  J            join N-1 lines (delete newlines)
  214. {visual}J       join the highlighted lines
  215. :[range]d [x]   delete [range] lines [into register x]
  216.  
  217. Copying and moving text
  218.    "<char>      use register <char> for the next delete, yank or put
  219. :dis            show the current register contents
  220. N  y{motion}    yank the text, moved over with {motion}, into a register
  221. {visual}y       yank the highlighted text into a register
  222. N  yy           yank N lines into a register
  223. N  Y            yank N lines into a register
  224. N  p            put a register after the cursor position (N times)
  225. N  P            put a register before the cursor position (N times)
  226. N  ]p           like p, but adjust indent to current line
  227. N  [p           like P, but adjust indent to current line
  228. Repeating commands
  229. N  .            repeat last change (with count replaced by N)
  230.    q<a-z>       record typed characters into register <a-z>
  231.    q            stop recording
  232. N  @<a-z>       execute the contents of register <a-z> (N times)
  233. N  @@           repeat previous @<a-z> (N times)
  234. :@<a-z>         execute the contents of register <a-z> as an Ex command
  235. :@@             repeat previous :@<a-z>
  236. :[range]g[lobal]/{pattern}/[cmd]
  237.                 Execute Ex command [cmd] (default :p) on the lines within
  238.                 [range] where {pattern} matches.
  239. :[range]g[lobal]!/{pattern}/[cmd]
  240.                 Execute Ex command [cmd] (default :p) on the lines within
  241.                 [range] where {pattern} does NOT match.
  242. :so[urce] {file}
  243.                 Read Ex commands from {file}.
  244. :so[urce]! {file}
  245.                 Read VIM commands from {file}.
  246. :sl[eep] [N[    don't do anything for N seconds
  247. N  gs           goto sleep for N seconds
  248. Key mapping
  249. :ma[p] {lhs} {rhs}      Map {lhs} to {rhs} in normal mode.
  250. :ma[p]! {lhs} {rhs}     Map {lhs} to {rhs} in insert and command line mode.
  251. :no[remap][!] {lhs} {rhs}
  252.                         Same as :map, no remapping for this {rhs}
  253. :unm[ap] {lhs}          Remove the mapping of {lhs} for normal mode.
  254. :unm[ap]! {lhs}         Remove the mapping of {lhs} for insert and command
  255.                         line mode.
  256. :ma[p] [lhs]            List mappings (starting with [lhs]) for normal mode.
  257. :ma[p]! [lhs]           List mappings (starting with [lhs]) for insert and
  258.                         command line mode.
  259. :cmap/:cunmap/:cnoremap like map/unmap/noremap but for command line mode only
  260. :imap/:iunmap/:inoremap like map/unmap/noremap but for insert mode only
  261. :mk[exrc][!] [file]     write current mappings, abbreviations and settings
  262.                         to [file] (default ".exrc"; use ! to overwrite)
  263. :mkv[imrc][!] [file]    same as :mkexrc, but with default ".vimrc"
  264.  
  265. Abbreviations
  266. :ab[breviate] {lhs} {rhs}    add abbreviation for {lhs} to {rhs}
  267. :ab[breviate] {lhs}          show abbreviations that start with {lhs}
  268. :ab[breviate]                show all abbreviations
  269. :una[bbreviate] {lhs}        remove abbreviation for {lhs}
  270. :iab/:cab/:iunab/:cunab/:noreab/:cnoreab/:inoreab    also available!
  271. Options
  272. :se[t]                  Show all modified options.
  273. :se[t] all              Show all options.
  274. :se[t] {option}         Set toggle option on, show string or number option.
  275. :se[t] no{option}       Set toggle option off.
  276. :se[t] inv{option}      invert toggle option.
  277. :se[t] {option}={value} Set string or number option to {value}.
  278. :se[t] {option}?        Show value of {option}.
  279.  
  280. option (shorthand)   type  default        effect
  281. autoindent (ai)     toggle    off   insert mode: copy indent from prev line
  282. autowrite (aw)      toggle    off   write the file when starting a new edit
  283. backspace (bs)      number    0     0 standard Vi, 1 delete NL, 2 delete all
  284. backup (bk)         toggle    on    backup a file before overwriting it
  285. backupdir (bdir)    string    "~/"  Unix only: Directory for backup files
  286. binary (bin)        toggle    off   binary file mode
  287. bioskey (bk)        toggle    on    MSDOS: use bios to get characters
  288. cmdheight (ch)      number     1    number of lines for the command line
  289. columns (co)        number    80    number of columns in the display
  290. compatible (cp)     toggle    off   set options for maximum vi-compatibility
  291. option (shorthand)   type  default        effect
  292. digraph (dg)        toggle    off   enable <BS> digraphs in insert mode
  293. directory (dir)     string    ""    directory to put swap file
  294. edcompatible        toggle    off   flags for :substitute toggle
  295. endofline (eol)     toggle    on    last line has a newline character
  296. equalalways (ea)    toggle    on    windows made equal height after open/close
  297. equalprg (ep)       string    "indent"  program used for '=' command
  298. errorbells (eb)     toggle    off   ring the bell for error messages
  299. errorfile (ef)      string    "AztecC.Err" file for QuickFix option
  300. errorformat (efm)   string          format of error messages from compiler
  301. esckeys (ek)        toggle    on    func. keys with <ESC> work in insert mode
  302. expandtab (et)      toggle    off   insert mode: use spaces to enter a tab
  303. exrc                toggle    off   read .exrc/.vimrc from current directory
  304. formatprg (fp)      string    ""    external program for 'Q' command
  305. gdefault (gd)       toggle    off   the 'g' flag is default on for :substitute
  306. graphic (gr)        toggle    off   display chars 0x80-0x9f directly
  307. helpfile (hf)       string    "vim:vim.hlp"     name of help file
  308. hidden (hid)        toggle    off   buffers become hidden when abandoned
  309. highlight (hl)      string    "db,es,hs,rs,vi,si"   when to use higlighting
  310. history (hi)        number    20    number of remembered command lines
  311. option (shorthand)   type  default        effect
  312. icon                toggle    off   set icon title to file name
  313. ignorecase (ic)     toggle    off   ignore case in search patterns
  314. insertmode (im)     toggle    off   start editing in insert mode
  315. joinspaces (js)     toggle    on    insert two spaces after a '.' with join
  316. keywordprg (kp)     string    "ref" name of program for 'K' command
  317. laststatus (ls)     number    1     when 0 last window has no status line, when
  318.                                     1 only with multiple windows, when 2 always
  319. lines               number    25    number of lines in the display
  320. list                toggle    off   display lines in list mode
  321. magic               toggle    on    different pattern matching characters
  322. makeprg (mp)        string    "make" name of program for ':make' command
  323. maxmem (mm)         number    512   How may Kbyte to use for one buffer
  324. maxmemtot (mmt)     number    512   How may Kbyte to use for all buffers
  325. modeline (ml)       toggle    on    lines are checked for set commands
  326. modelines (mls)     number    5     number of lines checked for set commands
  327. more                toggle    on    pause with long listings
  328. number (nu)         toggle    off   display line numbers
  329. option (shorthand)   type  default        effect
  330. paragraphs (para)   string    "IPLPPPQPP LIpplpipbp"
  331.                                     nroff macros that separate paragraphs
  332. paste               toggle    off   paste mode: insert literally
  333. patchmode (pm)      string    ""    extension to use when patching files
  334. readonly (ro)       toggle    off   overwriting the file not allowed
  335. remap               toggle    on    :map command works recursively
  336. report              number    2     minimal number of lines for reporting
  337. revins (ri)         toggle    off   insert characters right to left
  338. ruler (ru)          toggle    off   show cursor position in status line
  339. scroll              number    12    scroll size for CTRL-U and CTRL-D
  340. scrolljump (sj)     number    1     minimal number of lines for scrolling
  341. sections (sect)     string    "SHNHH HUnhsh"      macros separating sections
  342. secure              toggle    off   security checks for .vimrc and .exrc
  343. shell (sh)          string    "sh"  shell to use for ! and :! commands
  344. shellpipe (sh)      string          pipe command to be used for :make
  345. shelltype (st)      number    0     how to use the shell (Amiga only)
  346. shiftround (sr)     toggle    off   round indent to shiftwidth with > and <
  347. shiftwidth (sw)     number    8     number of spaces to use for (auto)indent
  348. shortname (sn)      toggle    off   MSDOS-like filesystem being used
  349. showcmd (sc)        toggle    on    show command in status line
  350. showmatch (sm)      toggle    off   show matching bracket if one is inserted
  351. option (shorthand)   type  default        effect
  352. showmode (smd)      toggle    on    show insert/replace mode message
  353. sidescroll (ss)     number    0     minimal nr of columns for horiz. scroll
  354. smartindent (si)    toggle    off   do smart autoindenting
  355. smarttab (sta)      toggle    off   tab size depends on position
  356. splitbelow (sb)     toggle    off   create new windows below current one
  357. suffixes (su)       string    ".bak.o.h.info.swp" suffixes that are ignored
  358.                                     when multiple files match a wildcard
  359. tabstop (ts)        number    8     number of spaces that a TAB counts for
  360. taglength (tl)      number    0     if non-zero, tags are significant upto
  361.                                         this number of characters
  362. tagrelative (tr)    toggle    on    file names in tags file are relative
  363. tags                string    "tags"   names of tag files
  364. term                string    "amiga"   name of terminal
  365. terse               toggle    off   make some messages shorter
  366. textauto (ta)       toggle    on    detect line separator, (re)set 'textmode'
  367. textmode (tx)       toggle    off   use <CR><LF> for line separator
  368. textwidth (tw)      number    0     maximum width of a line in insert mode
  369. tildeop (to)        toggle    off   tilde behaves like an operator
  370. timeout             toggle    on    wait only 'tm' msec for mappings&key codes
  371. option (shorthand)   type  default        effect
  372. ttimeout            toggle    off   wait only 'tm' msec for key codes
  373. timeoutlen (tm)     number    1000  milliseconds to wait for mappings&key codes
  374. title               toggle    on    set window title to file name
  375. ttyfast (tf)        toggle    off   don't use scroll commands for terminal
  376. undolevels (ul)     number    100   number of changes that can be undone
  377.                                         (0 for Vi compatibility)
  378. updatecount (uc)    number    200   after this many key hits swap file updated
  379. updatetime (ut)     number    4000  after this many mil.sec. swap file updated
  380. visualbell (vb)     toggle    off   use visual instead of audible beep
  381. warn                toggle    on    warn when changes and shell command used
  382. weirdinvert (wi)    toggle    off   terminal has a weird invert behaviour
  383. whichwrap (ww)      number    3     which left/right move commands wrap
  384. wildchar (wc)       number    TAB   char used to start filename completion
  385. winheight (wh)      number    0     minimal number of lines for current window
  386. wrap                toggle    on    when off: horizontal scrolling
  387. wrapmargin (wm)     number    0     wrap text when at (columns - wrapmargin)
  388. wrapscan (ws)       toggle    on    searches wrap around the end of the file
  389. writeany (wa)       toggle    off   always write file without asking
  390. writebackup (wb)    toggle    on    backup a file WHILE overwriting it
  391. yankendofline (ye)  toggle    off   'Y' yanks from cursor to end of line
  392. Undo/Redo commands
  393. N  u            undo N last changes
  394. N  CTRL-R       redo N last undone changes
  395.    U            restore last changed line
  396. External commands
  397. :sh             start a shell
  398. :!{command}     execute {command} with a shell
  399.    K            lookup keyword under the cursor with 'keywordprg' program
  400. Quickfix commands
  401. :cc [nr]        display error [nr] (default is the same again)
  402. :cn             display the next error
  403. :cp             display the previous error
  404. :cl             list all errors
  405. :cf             read errors from the file 'errorfile'
  406. :cq             quit without writing and return error code (to the compiler)
  407. :make [args]    start make, read errors and jump to first error
  408. Various commands
  409.    CTRL-L       Clear and redraw the screen.
  410.    CTRL-G       show current file name (with path) and cursor position
  411.    CTRL-C       during searches: interrupt the search
  412.    <DEL>        while entering a count: delete last character
  413. :vers           show exact version number of this VIM
  414. :mode N         MSDOS: set screen mode to N (number, C80, C4350, etc.)
  415. Command line editing
  416. <ESC>              abandon command line (if 'wildchar' is <ESC> type it twice)
  417. CTRL-V {char}      insert {char} literally
  418. CTRL-V {number}    enter decimal byte value (up to three digits)
  419. <C_LEFT>/<C_RIGHT> cursor left/right
  420. <SC_LEFT>/<SC_RIGHT>  cursor one word left/right
  421. CTRL-B/CTRL-E      cursor to begin/end of command line
  422. <BS>               delete the character in front of the cursor
  423. <DEL>              delete the character under the cursor
  424. CTRL-W             delete the word in front of the cursor
  425. CTRL-U             remove all characters
  426. <C_UP>/<C_DOWN>    recall older/newer command line from history
  427. <SC_UP>/<SC_DOWN>  recall older/newer command that starts with current command
  428.  
  429. Context sensitive completion
  430. 'wildchar'  (def. <TAB>)  do completion on the pattern in front of the cursor
  431. CTRL-D             list all names that match the pattern in front of the cursor
  432. CTRL-A             insert all names that match pattern in front of cursor
  433. CTRL-L             insert longest common part of names that match pattern
  434. CTRL-N             after 'wildchar' with multiple matches: go to next match
  435. CTRL-P             after 'wildchar' with multiple matches: go to previous match
  436. Ex ranges
  437. ,               separates two line numbers
  438. ;               idem, set cursor to the first line number
  439.  
  440. {number}        an absolute line number
  441. .               the current line
  442. $               the last line in the file
  443. %               equal to 1,$ (the entire file)
  444. 't              position of mark t
  445. /{pattern}      the next line where {pattern} matches
  446. ?{pattern}      the previous line where {pattern} matches
  447.  
  448. +[num]          add [num] to the preceding line number (default 1)
  449. -[num]          subtract [num] from the preceding line number (default 1)
  450.  
  451. Special Ex characters
  452.     |           separates two commands (not for ":global" and ":!")
  453.     "           begins comment
  454.     #[number]   alternate filename [number] (only where filename is expected)
  455.     %           current filename (only where filename is expected)
  456.     %<  or #<   idem, but without extension
  457. Editing a file
  458. :e                      Edit the current file, unless changes have been made.
  459. :e!                     Edit the current file always. Discard any changes.
  460. :e[dit] {file}          Edit {file}, unless changes have been made.
  461. :e[dit]! {file}         Edit {file} always. Discard any changes.
  462. N   CTRL-^              Edit alternate file N (equivalent to ":e #N").
  463. gf  or ]f               Edit the file whose name is under the cursor
  464. :pwd                    Print the current directory name.
  465. :cd [path]              Change the current directory to [path].
  466. :f[ile]                 Print the current filename and the cursor position.
  467. :f[ile] {name}          Set the current filename to {name}.
  468. :files                  Show alternate file names.
  469.  
  470. Using the file list
  471. :ar[gs]                 Print the file list, with the current file in "[]".
  472. :all  or :sall          Open a window for every file.
  473. :wn[ext][!]             Write file and edit next file.
  474. :wn[ext][!] {file}      Write to {file} and edit next file, unless {file}
  475.                         exists. With ! overwrite existing files.
  476. :wN[ext][!] [file]      Write file and edit previous file.
  477.  
  478. in current window    in new window
  479. :argu[ment] N        :sar[gument] N        Edit file N
  480. :n[ext]              :sn[ext]              Edit next file
  481. :n[ext] {filelist}   :sn[ext] {filelist}   define new list of files and edit
  482.                                                 the first one
  483. :N[ext]              :sN[ext]              Edit previous file
  484. :rew[ind][!]         :srew[ind]            Edit first file
  485. :last                :slast                Edit last file
  486.  
  487. Writing and quitting
  488. :[range]w[rite][!]      Write to the current file.
  489. :[range]w[rite] {file}  Write to {file}, unless it already exists.
  490. :[range]w[rite]! {file} Write to {file}. Overwrite an existing file.
  491. :[range]w[rite][!] >>   Append to the current file.
  492. :[range]w[rite][!] >> {file}
  493.                         Append to {file}.
  494. :[range]w[rite] !{cmd}  Execute {cmd} with [range] lines as standard input.
  495. :wall[!]                write all changed buffers
  496.  
  497. :q[uit]                 Quit, unless changes have been made.
  498. :q[uit]!                Quit always, discard any changes.
  499. :qall[!]                exit, also when buffers and windows open
  500. :cq                     Quit without writing and return error code
  501. :wq[!]                  Write the current file and exit.
  502. :wq[!] {file}           Write to {file} and exit.
  503. :x[it][!] [file]        Like ":wq" but write only when changes have been made
  504.    ZZ                   Same as ":x".
  505. :xall[!]  or :wqall[!]  write all changed buffers and exit
  506.  
  507. :st[op][!]              suspend VIM or start new shell. If 'aw' option is set
  508.                         and [!] not given write the buffer.
  509. CTRL-Z                  same as ":stop!"
  510. Starting VIM
  511. vim [options]           start editing with an empty buffer
  512. vim [options] {file ..} start editing one or more files
  513. vim [options] -t {tag}  edit the file associated with {tag}
  514. vim [options] -e [fname] start editing in QuickFix mode, display the first error
  515. Options
  516. +[num]                  put the cursor at line [num] (default last line)
  517. +/{pat} {file ..}       put the cursor at the first occurrence of {pat}
  518. -v                      read-only mode (View), implies -n
  519. -b                      binary mode
  520. -r                      recover aborted edit, using ".swp" file
  521. -n                      do not create ".swp" file
  522. -o [N]                  open N windows (default: one for each file)
  523. -x                      do not restart VIM to open a window (for e.g. mail)
  524. -s {scriptin}           first read the commands in the file {scriptin}
  525. -w {scriptout}          write all typed characters to the file {scriptout}
  526. -T {terminal}           set terminal type
  527. -d {device}             open {device} to be used as a console
  528.  
  529. Automatic option setting when editing a file
  530. vim:{set-arg}: ..       In the first and last lines of the file (see 'ml'
  531.                         option), {set-arg} is given as an argument to :set
  532. Multi window functions
  533. CTRL-W s  or :split     Split window in two parts
  534. :split <file>           Split window and edit <file> in one of them
  535. CTRL-W ]                Split window and jump to tag under cursor
  536. CTRL-W f                Split window and edit file name under the cursor
  537. CTRL-W n  or :new       Create new empty window
  538. CTRL-W q  or :q[uit]    Quit editing and close window
  539. CTRL-W c  or :cl[ose]   Make buffer hidden and close window
  540. CTRL-W o  or :o[nly]    Make current window only one on the screen
  541.  
  542. CTRL-W j                Move cursor to window below
  543. CTRL-W k                Move cursor to window above
  544. CTRL-W CTRL-W           Move cursor to next window (wrap around)
  545. CTRL-W p                Move cursor to previous active window
  546.  
  547. CTRL-W r                Rotate windows downwards
  548. CTRL-W R                Rotate windows upwards
  549. CTRL-W x                Exchange current window with next one
  550.  
  551. CTRL-W =                Make all windows equal height
  552. CTRL-W -                decrease current window height
  553. CTRL-W +                increase current window height
  554. CTRL-W _                Set current window height (default: very high)
  555. Buffer list functions
  556. :buffers  or :files     list all known buffer and file names
  557.  
  558. :ball     or :sball     edit all args/buffers
  559. :unhide   or :sunhide   edit all loaded buffers
  560.  
  561. in current window     in new window
  562. :[N]buffer [N]       :[N]sbuffer [N]       to arg/buf N
  563. :[N]bnext [N]        :[N]sbnext [N]        to Nth next arg/buf
  564. :[N]bNext [N]        :[N]sbNext [N]        to Nth previous arg/buf
  565. :[N]bprevious [N]    :[N]sbprevious [N]    to Nth previous arg/buf
  566. :brewind             :sbrewind             to first arg/buf
  567. :blast               :sblast               to last arg/buf
  568. :[N]bmod [N]         :[N]sbmod [N]         to Nth modified buf
  569.  
  570. :bunload[!] [N]          unload buffer [N] from memory
  571. :bdelete[!] [N]          unload buffer [N] and delete it from the buffer list
  572.